@extends('admin.main')
@section('body')
	<div class="main-title">
		<h2>{{isset($info['id']) ? '编辑':'新增'}}服务套餐</h2>
	</div>
	<div class="tab-wrap">
		<div class="tab-content">
			<form action="" method="post" class="form-horizontal">
				<!-- 基础 -->
				<div id="tab1" class="tab-pane in tab1">
					<div class="form-item">
						<label class="item-label">
							套餐名称<span class="check-tips"></span>
						</label>
						<div class="controls">
							<input type="text" name="name" class="text input-large" value="{{isset($info['name']) ? $info['name'] : ''}}">
						</div>
					</div>
					<div class="form-item">
						<label class="item-label">所属权限组<span class="check-tips"></span></label>
						<div class="controls">
							<select name="group_id">
								@if(count($groups))
									@foreach($groups as $v)
										<option value="{{$v['id']}}"
												@if(isset($info['group_id']) && $info['group_id'] == $v['id']) selected @endif>{{$v['title']}}</option>
									@endforeach
								@endif
							</select>
						</div>
					</div>
					<div class="form-item">
						<label class="item-label">
							服务期限<span class="check-tips"></span>
						</label>
						<div class="controls">
							<input type="text" name="time" class="text input-large" value="{{isset($info['time']) ? $info['time'] : ''}}"> 年
						</div>
					</div>
					{{--<div class="form-item">--}}
						{{--<label class="item-label">--}}
							{{--基础服务费<span class="check-tips"></span>--}}
						{{--</label>--}}
						{{--<div class="controls">--}}
							{{--<input type="text" name="base_price" class="text input-large" value="{{isset($info['base_price']) ? $info['base_price'] : 0}}"> 元--}}
						{{--</div>--}}
					{{--</div>--}}
					<div class="form-item">
						<label class="item-label">
							开店资费<span class="check-tips">(可设置收费范围，如果固定一个价格请填写一个数字即可，不收费则不填)</span>
						</label>
						<div class="controls">
							<textarea name="shop_price" rows="10" cols="20"
									  placeholder="格式：&#13;&#10;1,50:688&#13;&#10;51,100:588">{{isset($info['shop_price']) ? $info['shop_price'] : ''}}
							</textarea>
						</div>
					</div>
				</div>
				<div class="form-item">
					<input type="hidden" name="id" value="{{isset($info['id']) ? $info['id'] : ''}}">
					<button type="submit" id="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
					<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
				</div>
			</form>
		</div>
	</div>
@endsection
@section('script')
	<script type="text/javascript">
		$(function(){
			showTab();
			$("input[name=reply]").change(function(){
				var $reply = $(".form-item.reply");
				parseInt(this.value) ? $reply.show() : $reply.hide();
			}).filter(":checked").change();
		});
	</script>
@endsection
